package com.xinqi.modules.user.users.ueuse.manager.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.modules.user.users.ueuse.domain.UserUseLogEntity;
import com.xinqi.modules.user.user.ueuse.dto.req.UserUseQueryDTO;
import com.xinqi.modules.user.user.ueuse.dto.rsp.UserUseDateResultDTO;
import com.xinqi.modules.user.user.ueuse.dto.rsp.UserUseResultDTO;
import com.xinqi.common.base.response.Param;
import com.xinqi.common.mybatis.data.service.impl.BaseServiceImpl;
import com.xinqi.common.mybatis.utils.Pages;
import com.xinqi.modules.user.users.ueuse.manager.UserUseLogManager;
import com.xinqi.modules.user.users.ueuse.mapper.UserUseLogMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户使用管理层
 * @author: dzy
 * @date: 2023/04/01
 */
@Service
@RequiredArgsConstructor
public class UserUserLogManagerImpl extends BaseServiceImpl<UserUseLogMapper, UserUseLogEntity> implements UserUseLogManager {

    private final UserUseLogMapper userUseLogMapper;

    @Override
    public Page<UserUseDateResultDTO> datePage(Param param, Long userId) {
        return userUseLogMapper.findDatePage(Pages.page(param), userId);
    }

    @Override
    public Page<UserUseResultDTO> page(UserUseQueryDTO query) {
        return userUseLogMapper.findPage(Pages.page(query), query);
    }

    @Override
    public List<UserUseResultDTO> list(UserUseQueryDTO query) {
        return userUseLogMapper.findList(query);
    }

}
